/**
 * @projectName 高校就业网
 * @package com.kzj.CollegeEmploymentNetwork.common
 * @className com.kzj.CollegeEmploymentNetwork.common.BaseEntity
 * @copyright Copyright 2025 Thunisoft, Inc. All rights reserved.
 */
package com.kzj.CollegeEmploymentNetwork.common;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.validation.constraints.Size;
import com.kzj.CollegeEmploymentNetwork.validate.Validate;
import java.time.LocalDateTime;
import org.springframework.format.annotation.DateTimeFormat;
import com.alibaba.fastjson.annotation.JSONField;


import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;

/**
 * BaseEntity
 *
 * @description 基础类
 * @author kzj
 * @date 2025年01月20日 23:11:54
 * @version 1.0.0
 */
@Getter
@Setter
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
@MappedSuperclass
public class BaseEntity implements Serializable {

    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = 1L;
    
    /**
     * 主键
     */
    @ApiModelProperty("主键")
    @Column(name = "c_bh", columnDefinition = "varchar(32)")
    @Size(max = 32, groups = {Validate.class}, message = "主键的最大长度为32")
    @Id
    private String bh;

    /**
     * 最后修改方式，1、创建2、修改
     */
    @ApiModelProperty("最后修改方式，1、创建2、修改")
    @Column(name = "n_zhxgfs")
    private Integer zhxgfs;

    /**
     * 创建人
     */
    @ApiModelProperty("创建人")
    @Column(name = "c_cjr", columnDefinition = "varchar(300)")
    @Size(max = 300, groups = {Validate.class}, message = "创建人的最大长度为300")
    private String cjr;

    /**
     * 最后修改人
     */
    @ApiModelProperty("最后修改人")
    @Column(name = "c_zhxgr", columnDefinition = "varchar(300)")
    @Size(max = 300, groups = {Validate.class}, message = "最后修改人的最大长度为300")
    private String zhxgr;

    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    @Column(name = "dt_cjsj", columnDefinition = "datetime")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime cjsj;

    /**
     * 最后修改时间
     */
    @ApiModelProperty("最后修改时间")
    @Column(name = "dt_zhxgsj", columnDefinition = "datetime")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime zhxgsj;

}